package kaka.controls.datagrid
{
	import kaka.controls.datagrid.factory.CreateFactory;
	
	import mx.core.IFactory;

	/**
	 * 表格每一列信息,包括表头渲染器，渲染编辑器
	 * @author kaka
	 */
	public class ColumnInfo
	{
		private var _headertext:String;
		private var _datafield:String;
		private var _itemRenderer:IFactory;
		private var _editRenderer:IFactory;
		/**
		 * constructed function<br/>
		 * 初始化列信息
		 * @param headertext 表列名
		 * @param datafield
		 * @param itemRenderer
		 **/
		public function ColumnInfo(headertext:String,datafield:String,itemRenderer:Class=null,editRenderer:Class=null)
		{
			this.headertext=headertext;
			this.datafield=datafield;
			if(itemRenderer!=null)
			{
				_itemRenderer=CreateFactory.createRenderer(itemRenderer);
			}
			if(editRenderer!=null)
			{
				_editRenderer=CreateFactory.createRenderer(editRenderer);
			}
		}

		public function get datafield():String
		{
			return _datafield;
		}

		public function set datafield(value:String):void
		{
			_datafield = value;
		}

		public function get headertext():String
		{
			return _headertext;
		}

		public function set headertext(value:String):void
		{
			_headertext = value;
		}

		public function get itemRenderer():IFactory
		{
			return _itemRenderer;
		}

		public function set itemRenderer(value:IFactory):void
		{
			_itemRenderer = value;
		}

		public function get editRenderer():IFactory
		{
			return _editRenderer;
		}

		public function set editRenderer(value:IFactory):void
		{
			_editRenderer = value;
		}


	}
}